package com.xiangban.yanglaodajie_platform.utils;

import com.github.wxpay.sdk.WXPayConfig;
import com.xiangban.yanglaodajie_platform.config.WxParameterConfig;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

public class WXConfigUtil implements WXPayConfig {

    private byte[] certData;
    public static final String APP_ID = "wx704de494906e86d2";
    public static final String APP_KEY = "e44b35bad851fcf81c6ff404d7139b75"; //在微信商户平台上设置API密钥
    public static final String MCH_ID = "1592250041";

    @Override
    public String getAppID() {
        return APP_ID;
    }
    @Override
    public String getMchID() {
        return MCH_ID;
    }

    @Override
    public String getKey() {
        return APP_KEY;
    }

    @Override
    public InputStream getCertStream() {
        ByteArrayInputStream certBis = new ByteArrayInputStream(this.certData);
        return certBis;
    }

    @Override
    public int getHttpConnectTimeoutMs() {
        return 8000;
    }

    @Override
    public int getHttpReadTimeoutMs() {
        return 10000;
    }
}
